The present invention relates to an apparatus and method of detecting motion vectors used for motion compensation coding in motion picture compression, and more specifically to a process of selecting a motion vector when there are a plurality of candidate blocks which have the same correlation degree with a coding block.
In order to transmit and store motion picture signals via communication lines with small capacities, a picture compression technique is essential to reduce huge amount of data for picture signals.
Generally, picture signals have a high level of data redundancy and a lot of information which can be reduced. One method of realizing the picture compression of motion picture signals by eliminating such reducible information to decrease the level of data redundancy is an interframe predictive coding system. An interframe prediction refers to a prediction with the use of pixels in an immediately preceding frame or in a further previous frame. According to the interframe predictive coding system, a high level of picture compression is possible for motion pictures having a small movement; however, great effects cannot be expected for motion pictures having a large movement because of a low correlation degree between frames.
In order to solve such a drawback of the interframe predictive coding system, a motion compensation interframe predictive coding system with motion vectors is available. The motion vectors used in the motion compensation interframe predictive coding system are usually detected by a block matching method. According to the block matching method, as shown in FIG. 11, the correlation degree is evaluated between a coding block consisting of (Mxc3x97N) pixels within a current frame (a coding frame) and each candidate block consisting of (Mxc3x97N) pixels in a search area which is set within a reference frame different in time from the current frame. The evaluation value of the correlation degree can be determined, for example, by cumulating the absolute value of the difference between the value of a pixel in a coding block and the value of the corresponding pixel in a candidate block. The displacement between the candidate block which has the smallest evaluation value of the determined correlation degree and the coding block which is reflected on the reference frame is detected as a motion vector.
In such a block matching method, more than one candidate block within a search area may possibly have the same evaluation value, so that it is necessary to select one from among the candidate blocks having the same evaluation value, so as to determine the best motion vector.
One conventional selection method for such a case is to previously assign a higher priority to a motion vector having a smaller sum of the absolute values of the horizontal and vertical components, and to compare the assigned priorities so as to determine the best motion vector when more than a plurality of motion vectors have the same smallest evaluation value (Japanese Laid-open Patent Application No. 6-30399). FIG. 12 shows the priority values for the motion vector detection in accordance with this conventional method. The numbers at the top and leftmost indicate the horizontal and vertical components of the motion vectors, respectively. The number in each square indicates priority assigned to a motion vector whose horizontal and vertical components are shown at the top and leftmost, respectively
According to the conventional motion vector detection method, the best motion vector is selected in accordance with the above-mentioned priority; however, motion vectors are consecutively variable-coded, so that there is no guarantee that a motion vector whose code length becomes short when a motion vector string has been variable-coded is selected.
In the variable coding of the motion vector string, when the difference between two consecutive motion vectors is variable-coded, the conventional motion vector detection method does not enable a motion vector whose code length becomes short to be selected, which fails to realize an efficient picture compression processing.
In addition, the conventional motion vector detection method requires a means for storing the above-mentioned priorities, which causes an increase in the circuit scale. Furthermore, in order to make a selection index for selecting the best motion vector be calculated every time the best motion vector is selected, instead of assigning priorities to motion vectors in advance, it is necessary to perform a troublesome calculation of adding the absolute values of the horizontal and vertical components of motion vectors every time a motion vector is selected, which also causes an increase in the circuit scale.
The present invention has an object of realizing a more efficient picture compression processing than ever in motion vector detection for motion picture compression coding, which improves the process of selecting a motion vector when a plurality of candidate blocks having the same evaluation value of the correlation degree have been detected from a search area.
To be more specific, the motion vector detection method in accordance with the present invention comprises the steps of detecting a candidate block, which has the highest correlation degree with a coding block in a coding frame picture, from a search area within a reference frame picture; determining that a motion vector which corresponds to the candidate block is a best motion vector; and when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, converting a plurality of motion vectors corresponding to the plurality of candidate blocks into variable codes, based on a predetermined coding system and selecting, as a best motion vector, a motion vector whose variable code obtained as a result of conversion has the shortest code length.
According to the above-mentioned motion vector detection method, when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, the motion vectors corresponding to these candidate blocks, respectively, are converted into variable codes based on a predetermined coding system used in the actual transmission or another system, and the motion vector whose variable code obtained as the result of conversion has the shortest code length is selected as the best motion vector. Consequently, the code length of the variable-coded best motion vector string becomes shorter, realizing an efficient picture compression processing.
Another motion vector detection method in accordance with the present invention comprises the steps of detecting a candidate block, which has the highest correlation degree with a coding block in a coding frame picture, from a search area within a reference frame picture; determining that a motion vector which corresponds to the candidate block is a best motion vector; and when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, using the largest one of absolute values of components of a motion vector as a selection index and selecting, as a best motion vector, a motion vector having the smallest selection index from among a plurality of motion vectors corresponding to the plurality of candidate blocks.
According to the above-mentioned motion vector detection method, in the variable coding of a best motion vector string, the smaller the absolute value of each component of the best motion vector is, the shorter its variable code becomes in many cases. Therefore, by selecting, as the best motion vector, a motion vector whose largest absolute value for its components, which is the selection index, is the smallest, a motion vector having a shorter variable code is selected as the best motion vector in most cases. As a result, when the best motion vector string is variable-coded, the code length becomes shorter. Furthermore, the addition of the absolute values of the components of a motion vector becomes unnecessary, which realizes motion vector detection with a smaller circuit scale than ever.
In selecting the best motion vector in accordance with the above-mentioned motion vector detection method, when there are a plurality of motion vectors having the smallest selection index, it is preferable that one absolute value among the absolute values of the components of a motion vector which has not been used as the selection index is used as a new selection index, and of the plurality of motion vectors having the smallest selection index, a motion vector having the smallest new selection index is selected as the best motion vector.
According to this, when there are a plurality of motion vectors having the smallest value of the selection index, the motion vector having the smallest new selection index, that is, one of the absolute values of the components of a motion vector which has not been used as the selection index is selected as a best motion vector. Therefore, a motion vector having a shorter variable code is selected as the best motion vector in most cases. As a result, when the best motion vector string is variable-coded, the code length becomes shorter, and accordingly, the priority in selecting motion vectors can be set further minutely.
Another motion vector detection method in accordance with the present invention comprises the steps of detecting a candidate block, which has the highest correlation degree with a coding block in a coding frame picture, from a search area within a reference frame picture; determining that a motion vector which corresponds to the candidate block is a best motion vector; and when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, calculating the difference between each of a plurality of motion vectors corresponding to the plurality of candidate blocks and a best motion vector which is variable-coded immediately before a best motion vector which is being determined, and selecting a best motion vector from among the plurality of motion vectors, based on the calculated difference.
According to the above-mentioned motion vector detection method, when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, a difference is calculated between each of a plurality of motion vectors corresponding to the plurality of candidate blocks and a best motion vector which is variable-coded immediately before a best motion vector which is being determined. Based on the calculated difference, the best motion vector is selected from among the plurality of motion vectors. Therefore, when the variable coding of a motion vector string is conducted by variable-coding the difference between two consecutive motion vectors, a motion vector is selected so that the code length of the motion vector string which has been variable-coded becomes short. As a result, an efficient picture compression processing can be realized.
A motion vector detection apparatus in accordance with the present invention comprises a correlation degree calculation unit for calculating a correlation degree between each candidate block in a search area within a reference frame picture and a coding block in a coding frame picture; and a best motion vector determination unit for determining that a motion vector which corresponds to a candidate block having the highest correlation degree with the coding block is a best motion vector, based on the calculation results obtained by the correlation degree calculation unit.
The best motion vector determination unit includes a motion vector selection unit for selecting one motion vector from among a plurality of motion vectors entered. In determining a best motion vector, when there are a plurality of candidate blocks having the same correlation degree, the motion vector selection unit selects, by the motion vector selection unit, one motion vector from a plurality of motion vectors corresponding to the plurality of candidate blocks, respectively. The motion vector selection unit includes a motion vector encoder for converting a motion vector into a variable code based on a predetermined coding system, converting the plurality of motion vectors into variable codes by the motion vector encoder, and selecting, as the above-mentioned one motion vector, a motion vector whose variable code obtained as a result of conversion has the shortest code length from among the plurality of motion vectors.
According to the above-mentioned motion vector detection apparatus, the plurality of motion vectors having the same correlation degree are converted into variable codes by the motion vector encoder, based on the predetermined coding system used for actual transmission or another system. The motion vector whose variable code obtained as a result of conversion has the shortest code length is selected as the above-mentioned motion vector. Therefore, when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, the motion vector whose variable code obtained as a result of conversion in actual transmission has the shortest code length is selected from among the plurality of motion vectors corresponding to the candidate blocks, respectively. As a result, the code length of the motion vector string which has been variable-coded becomes short, which allows an efficient picture compression processing to be always realized.
Another motion vector detection apparatus in accordance with the present invention comprises a correlation degree calculation unit for calculating a correlation degree between each candidate block in a search area within a reference frame picture and a coding block in a coding frame picture; and a best motion vector determination unit for determining that a motion vector which corresponds to a candidate block having the highest correlation degree with the coding block is a best motion vector, based on calculation results obtained by the correlation degree calculation unit. The best motion vector determination unit includes a motion vector selection unit for selecting one motion vector from among a plurality of motion vectors entered. In determining a best motion vector, when there are a plurality of candidate blocks having the same correlation degree, the best motion vector selects, by the motion vector selection unit, one motion vector from a plurality of motion vectors corresponding to the plurality of candidate blocks, respectively. The motion vector selection unit uses the largest one of absolute values of components of a motion vector as a selection index, and selects, as the above-mentioned one motion vector, a motion vector having the smallest selection index from among the plurality of motion vectors entered.
According to the above-mentioned motion vector detection apparatus, the motion vector selection unit selects, as the above-mentioned motion vector, the motion vector whose largest absolute value for its components, which is the selection index, is the smallest of the plurality of motion vectors having the same correlation degree. Therefore, when there are a plurality of candidate blocks having the highest correlation degree with the coding block within the search area, the motion vector whose largest absolute value for its components, which is the selection index, is the smallest is selected as the best motion vector from among the plurality of motion vectors corresponding to these candidate blocks, respectively.
Another motion vector detection apparatus in accordance with the present invention comprises a correlation degree calculation unit for calculating a correlation degree between each candidate block in a search area within a reference frame picture and a coding block in a coding frame picture; and a best motion vector determination unit for determining that a motion vector which corresponds to a candidate block having the highest correlation degree with the coding block is a best motion vector, based on calculation results obtained by the correlation degree calculation unit. The best motion vector determination unit includes a motion vector selection unit for selecting one motion vector from among a plurality of motion vectors entered. In determining a best motion vector, when there are a plurality of candidate blocks having the same correlation degree, the motion vector selection unit selects, by the motion vector selection unit, one motion vector from a plurality of motion vectors corresponding to the plurality of candidate blocks, respectively. The motion vector selection unit calculates the difference between each of the plurality of motion vectors entered and a best motion vector which is variable-coded immediately before a best motion vector which is being determined, and selects one motion vector from among the plurality of motion vectors entered, based on the calculated difference.
According to the above-mentioned motion vector detection apparatus, a difference is calculated between each of the plurality of motion vectors entered and the best motion vector which is variable-coded immediately before the best motion vector which is being determined. Based on the difference calculated, the best motion vector is selected from among the plurality of motion vectors. Therefore, when the variable coding of a motion vector string is conducted by variable-coding the difference between two consecutive motion vectors, a motion vector is selected so that the code length of the motion vector string which has been variable-coded becomes short. As a result, an efficient picture compression processing can be realized.